package com.team10.hotel.service.impl;

import com.team10.hotel.domain.HotelImage;
import com.team10.hotel.domain.Room;
import com.team10.hotel.domain.RoomImage;
import com.team10.hotel.mapper.HotelImageMapper;
import com.team10.hotel.mapper.RoomImageMapper;
import com.team10.hotel.mapper.RoomMapper;
import com.team10.hotel.service.HotelImageService;
import com.team10.hotel.service.RoomImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoomImageServiceImpl implements RoomImageService {
    @Autowired
    private RoomImageMapper roomImageMapper;


    @Override
    public int saveRoomImage(RoomImage roomImage) {
        return  roomImageMapper.insert(roomImage);
    }

    @Override
    public List<RoomImage> listRoomImage(Integer id) {
        return roomImageMapper.selectRoomImageByRoomId(id);
    }

    @Override
    public RoomImage findRoomImageByRoomId(Integer id) {
        return roomImageMapper.selectByPrimaryKey(id);
    }

    @Override
    public int deleteRoomImage(Integer id) {
        return roomImageMapper.deleteByPrimaryKey(id);
    }
}
